﻿/**
 * @file guild_members_logic.h
 * @date 2021/05/25 19:01
 *
 * @author harrybao (harrybao@123u.com)
 *
 * @brief 公会成员模块逻辑
 *
 * @version v1.0.0
 *
 * @copyright Copyright © 2021 All Rights Reserved 上海欢乐互娱网络科技有限公司
 *
 * @par history:
 * <table>
 * <tr><th>Date                     <th>Version     <th>Author <th>Description
 * <tr><td>2021/05/25 19:01         <td>1.0.0       <td>harrybao
 * <td>创建初始版本
 * </table>
 */

// #ifndef GUILD_MEMBERS_LOGIC_H
// #define GUILD_MEMBERS_LOGIC_H

#pragma once

#include "error/error_code.h"
#include "guild/guild.h"

struct GuildMember;
struct GuildModuleMembers;

struct GuildModuleRepository;
struct GetGuildRepositoryRoleViewRes;

namespace guild_service {

/**
 * @brief 公会成员模块逻辑类
 *
 */
class GuildMembersLogic {
 public:
  static bool GetGuildModuleMembers(const guild_id_type guild_id, GuildModuleMembers &members);

 public:
  /**
   * @brief 获取公会成员
   *
   * @param role_uuid 角色唯一id
   * @param member 公会成员
   * @return true
   * @return false
   */
  static bool GetGuildMember(const role_uuid_type role_uuid,
                             const role_uuid_type member_role_uuid,
                             GuildMember &member, error_code &ec);
  /**
   * @brief 获取公会成员列表
   * @param role_uuid 角色唯一id
   * @param member 公会成员列表
   * @param ec 错误码
   * @return
   */
  static bool GetGuildModuleMembers(const role_uuid_type role_uuid,
                              GuildModuleMembers &member_list, error_code &ec);

 public:
  static bool GetModuleRepository(const guild_id_type guild_id,
                                  GuildModuleRepository &module_repository);

  static bool GetGuildRepositoryRoleView(
      const role_uuid_type role_uuid, GetGuildRepositoryRoleViewRes &role_view,
      error_code &ec);
  /**
   * @brief 查询公会福利奖励
   *
   * @param role_uuid 角色唯一id
   * @param award 奖励
   * @param ec 错误码
   * @return true 查询成功
   * @return false 查询失败
   */
  static bool QueryGuildWelfareAward(const role_uuid_type role_uuid,
                                     uint64_t &award, error_code &ec);
};

}  // namespace guild_service

// #endif  // GUILD_MEMBERS_LOGIC_H